home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_lavabubboss1.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  127 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_LavaBubbles.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     entered
  13.     message     pulse
  14.     
  15.     thing       blurp           local
  16.     thing       bloop0
  17.     thing       bloop1
  18.     thing       bloop2
  19.     thing       bloop3
  20.     thing       bloop4
  21.     thing       bloop5
  22.     thing       bloop6
  23.     thing       bloop7
  24.     thing       bloop8
  25.     thing       bloop9
  26.     thing       bloop10
  27.     thing       bloop11
  28.     thing       bloop12
  29.     thing       bloop13
  30.     thing       bloop14
  31.     thing       bloop15
  32.     thing       bloop16
  33.     thing       bloop17
  34.     thing       bloop18
  35.     thing       bloop19
  36.     
  37.     sector      sec_Start1
  38.     sector      sec_Start2
  39.     sector      sec_Stop1
  40.     sector      sec_Stop2
  41.     
  42.     template    tpl_Bubble=lavabubopp       local
  43.     template    tpl_Sparks=lavasparks       local
  44.  
  45.     material    bubbleSkin=bubble_a4lava_top.mat        local
  46.     material    lavaSkin=gen_a4sfx_lava_particle.mat    local
  47.     
  48.     sound       sfx_Bloop0=gen_lava_bloop_a.wav      local
  49.     sound       sfx_Bloop1=gen_lava_blurp_a.wav      local
  50.     
  51.     int         animId      local
  52.     int         newBubble   local
  53.     int         oldBubble   local
  54.     int         bubbling=0  local
  55.     
  56.     
  57. end
  58.  
  59. # ========================================================================================
  60.  
  61. code
  62.  
  63. entered:
  64.  
  65.     if((GetSenderRef() == sec_Start1) || (GetSenderRef() == sec_Start2))
  66.     {
  67.         if(bubbling == 0)
  68.         {
  69.             Print("startBubbles");
  70.             bubbling = 1;
  71.             #Sleep(0.5);
  72.             SetPulse(1.0);
  73.         }
  74.     }
  75.  
  76.     if((GetSenderRef() == sec_Stop1) || (GetSenderRef() == sec_Stop2))
  77.     {
  78.         Print("stopBubbles");
  79.         SetPulse(0.0);
  80.         bubbling = 0;
  81.     }
  82.     
  83.     return;
  84.  
  85. # ========================================================================================
  86.  
  87. pulse:
  88.  
  89.     while (newBubble == oldBubble) 
  90.     {
  91.         newBubble = RandBetween(0, 19);
  92.     }
  93.     
  94.     oldBubble = newBubble;
  95.     
  96.     # create bubble at random position
  97.     blurp = CreateThing(tpl_Bubble, bloop0[newBubble]);
  98.     CaptureThing(blurp);
  99.     
  100.     # move bubble to frame
  101.     MoveToFrame(blurp, 1, 1.5);
  102.     
  103.     # animate the bubble mat
  104.     SetMaterialCel(bubbleskin, 0);
  105.     animId = MaterialAnim(bubbleskin, 48, 0);
  106.     
  107.     # play the bloop/blurp sfx
  108.     PlaySoundThing(sfx_Bloop0[RandBetween(0, 1)], blurp, 1.0, 18.0, 23.0, 0x0);
  109.     
  110.     # create lava sparks
  111.     SetMaterialCel(lavaskin, 0);
  112.     CreateThing(tpl_Sparks, bloop0[newBubble]);
  113.     MaterialAnim(lavaskin, 4, 0);
  114.     
  115.     # get ready for the next one
  116.     WaitForStop(blurp);
  117.     Sleep(0.45);
  118.     #StopAnim(animId);
  119.     DestroyThing(blurp);
  120.     
  121.     return;
  122.  
  123. # ========================================================================================
  124.  
  125. end
  126.  
  127.